-- CALC_BINE_MAX_HP

-- 计算魔藤最大血量
-- @param bine    魔藤
return function(bine)
    local level = bine:getLevel();
    local max_hp = FormulaM.invoke("BINE_BASE_HP", level);

    -- 玩家对召唤兽属性加成
    local addon_hp = FormulaM.invoke("SUMMON_ATTRIB_ADDITION", bine, max_hp, "max_hp");

    -- 加成
    local prop = PropM.combine(bine, "attrib2", "max_hp");
    max_hp = PropM.apply(prop, max_hp);

    -- 所有召唤物能力加
    prop = PropM.combine(ME.user, "summon_attrib", "hp");
    max_hp = PropM.apply(prop, max_hp);

    -- 玩家属性加成
    if ME.user:queryAttrib("bine_attrib") > 0 then
        max_hp = max_hp + 30;
    end

    return max_hp + addon_hp;
end
